package ar.edu.caece.pl.asem.model.impl.treeelements;

import ar.edu.caece.pl.asem.model.impl.SymbolTable;


public class Arreglo extends SimboloGenerico {
	
	private int length;	//Solo para arrays
	
	public Arreglo(String name, int type, int length) {
		super(name, type);
		this.length = length;
		this.label = "ARREGLO";
	}
	
	public int getLength() {
		return length;
	}
	
	public void setLength(int length) {
		this.length = length;
	}
	
	@Override
	public String toString() {
		
		return this.getLabel()+": "+this.getName() + " (" + SymbolTable.getVerboseType(this.getType()) + ") = "+this.getLength();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Arreglo other = (Arreglo) obj;
		if (length != other.length)
			return false;
		return true;
	}

	@Override
	public String generateASMCode() {
		// TODO Auto-generated method stub
		return null;
	}

	
}
